package com.learn.springboot.learnspringboot;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@SpringBootApplication
public class LearnspringbootApplication {

  @Value(value = "book.author")
  private String author;

  @Value(value = "book.name")
  private String name;

  public static void main(String[] args) {
    SpringApplication app=new SpringApplication(LearnspringbootApplication.class);
    System.out.println("0111199");
    app.run(args);
    //SpringApplication.run(LearnspringbootApplication.class, args);
  }


  @RequestMapping("/index")
  public String index(){
    return "hello spring boot 2.1;作者是："+author+"名字是:"+name;
  }
}
